package com.dy.springcloud.service;

import com.dy.springcloud.entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

//openfeign的核心
@Component//直接注入。可以获取登录代理对象
//服务名不可以用  _   ,springcloud识别不了，会报错
@FeignClient(value = "seata-account-micro-service")//服务提供集群的注册别名
public interface AccountService {

    @PostMapping("/account/reduce")
    public Result result(@RequestParam("userId") Long userId, @RequestParam("money") Integer money);
}
